<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveTest::Base</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveTest::Base</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/lib/active_test/base_rb.html">
                lib/active_test/base.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Test::Unit::TestCase
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
<a href="Base.html">ActiveTest::Base</a> wraps the original
Test::Unit::TestCase in a non-invasive manner.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000045">method_added</a>&nbsp;&nbsp;
      <a href="#M000042">setup</a>&nbsp;&nbsp;
      <a href="#M000041">setup_with_nesting</a>&nbsp;&nbsp;
      <a href="#M000044">teardown</a>&nbsp;&nbsp;
      <a href="#M000043">teardown_with_nesting</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000045" class="method-detail">
        <a name="M000045"></a>

        <div class="method-heading">
          <a href="#M000045" class="method-signature">
          <span class="method-name">method_added</span><span class="method-args">(symbol)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Suck in every setup and teardown defined, unbind it, remove it and execute
it on the child. From here on out, we nest setup/teardown.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000045-source">
<pre>
    <span class="ruby-comment cmt"># File lib/active_test/base.rb, line 30</span>
30:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">method_added</span>(<span class="ruby-identifier">symbol</span>)
31:       <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">==</span> <span class="ruby-constant">ActiveTest</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>
32:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_s</span>
33:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'setup'</span>
34:           <span class="ruby-ivar">@@setup_methods</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">:setup</span>)]
35:           <span class="ruby-identifier">remove_method</span>(<span class="ruby-identifier">:setup</span>)
36:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'teardown'</span>
37:           <span class="ruby-ivar">@@teardown_methods</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">:teardown</span>)]
38:           <span class="ruby-identifier">remove_method</span>(<span class="ruby-identifier">:teardown</span>)
39:         <span class="ruby-keyword kw">end</span>
40:       <span class="ruby-keyword kw">end</span>
41:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000042" class="method-detail">
        <a name="M000042"></a>

        <div class="method-heading">
          <span class="method-name">setup</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="Base.html#M000041">setup_with_nesting</a>
</p>
        </div>
      </div>

      <div id="method-M000041" class="method-detail">
        <a name="M000041"></a>

        <div class="method-heading">
          <a href="#M000041" class="method-signature">
          <span class="method-name">setup_with_nesting</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Execute all defined setup methods beyond Test::Unit::TestCase.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000041-source">
<pre>
    <span class="ruby-comment cmt"># File lib/active_test/base.rb, line 17</span>
17:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup_with_nesting</span>
18:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">setup_methods</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">bind</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">call</span> }
19:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000044" class="method-detail">
        <a name="M000044"></a>

        <div class="method-heading">
          <span class="method-name">teardown</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="Base.html#M000043">teardown_with_nesting</a>
</p>
        </div>
      </div>

      <div id="method-M000043" class="method-detail">
        <a name="M000043"></a>

        <div class="method-heading">
          <a href="#M000043" class="method-signature">
          <span class="method-name">teardown_with_nesting</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Execute all defined teardown methods beyond Test::Unit::TestCase
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000043-source">
<pre>
    <span class="ruby-comment cmt"># File lib/active_test/base.rb, line 23</span>
23:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">teardown_with_nesting</span>
24:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">teardown_methods</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">bind</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">call</span> }
25:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>